FROM                 singulax:base
MAINTAINER           Summer           <yujianglei@singulax.com>

ENV         DATA_DIR  /data/mysql               

#Install Mysql-5.5
RUN          wget --directory-prefix=/tmp  http://mirrors.sohu.com/mysql/MySQL-5.5/MySQL-server-5.5.44-1.el6.x86_64.rpm
RUN          wget --directory-prefix=/tmp  http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm
RUN          wget --directory-prefix=/tmp  http://mirrors.sohu.com/mysql/MySQL-5.5/MySQL-client-5.5.44-1.el6.x86_64.rpm
RUN          rpm  -ivh  /tmp/libaio-0.3.107-10.el6.x86_64.rpm
RUN          rpm  -ivh  /tmp/MySQL-server-5.5.44-1.el6.x86_64.rpm
RUN          rpm  -ivh  /tmp/MySQL-client-5.5.44-1.el6.x86_64.rpm


ADD          mysqld_charset.cnf    /etc/my.cnf.d/


COPY scripts /scripts
RUN chmod -R 755 /scripts/

USER    root
EXPOSE 3306

VOLUME ["/data/mysql"]

ENTRYPOINT ["/scripts/start"]
